<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:faces="http://java.sun.com/jsf/composite/faces/components"
	xmlns:facesex="http://www.onionframework.org/components/facesex"
    template="/faces/template/list.xhtml">
	
	<ui:define name="head">
		<ui:param name="action" value="#{code.codeType}" />
		<ui:param name="editView" value="/code/codeTypeEdit.xhtml" />
    </ui:define>
	
	<ui:define name="queryFields">
		<faces:inputTextItem label="名称" value="#{action.queryParams.name_like}"/>
		<faces:inputTextItem label="说明" value="#{action.queryParams.description_like}"/>
		<div class="formBox_buttons">
			<a4j:commandButton value="查询" styleClass="formBox_commonButton" action="#{action.query}" reRender="dataTable,dataTableScroller"/>
			<input type="reset" class="formBox_commonButton" value="重置"/>
		</div>
	</ui:define>
	<!-- 按钮区 -->
	<ui:define name="listButtons">
		<faces:commonButtons actionBean="#{action}" editView="#{editView}"/>
	</ui:define>
	<!-- 表格工具区 -->
	<ui:define name="tableTools">
		<!-- 表格每页显示记录数组件，以及翻页组件 -->
		<faces:tableTools id="dataTableTools" for="dataTable" dataCount="#{action.datas.size}"/>
	</ui:define>
	<ui:define name="table">
		<rich:dataTable id="dataTable" styleClass="dataTable" rowKeyVar="key"
			binding="#{dataTable.table}" width="100%" rows="#{action.datas.pageSize}"
			value="#{action.datas}" var="item"
			onRowClick="onion.faces.list.selectRow(this,event);"
			onRowDblClick="onion.faces.list.dblClick(this,null,event);"
			onRowMouseOver="onion.faces.list.addHover(this,event);"
			onRowMouseOut="onion.faces.list.removeHover(this,event);"
			rowClasses="odd,even">
			<rich:column width="30" styleClass="checkboxcell" headerClass="checkboxcell">
				<f:facet name="header">
					<input type="checkbox" onclick="onion.faces.list.checkAllRows(this,event);"/>
				</f:facet>
				<h:selectBooleanCheckbox styleClass="#{key}" onclick="onion.faces.list.checkRow(this,event);" 
					valueChangeListener="#{dataTable.selectChanged}" />
				<span class="hiddenId">#{item.id}</span>
			</rich:column>
			<rich:column width="30" styleClass="rowKey">
				<f:facet name="header">序号</f:facet>
				#{key + 1}
			</rich:column>
			<rich:column>
				<f:facet name="header">名称</f:facet>
				#{item.name}
			</rich:column>
			<rich:column>
				<f:facet name="header">说明</f:facet>
				#{item.description}
			</rich:column>
			<rich:column>
				<f:facet name="header">创建时间</f:facet>
				<h:outputText value="#{item.createTime}">
					<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" />
				</h:outputText>
			</rich:column>
		</rich:dataTable>
	</ui:define>
</ui:composition>